Current wireless mobile communication devices include microprocessors, memory, soundcards, and run one or more software applications. Examples of software applications used in these wireless devices include micro-browsers, address books, email clients, instant messaging (“IM”) clients, and wavetable instruments. Additionally, wireless devices have access to a plurality of services via the Internet. A wireless device may, for example, be used to browse web sites on the Internet, to transmit and receive graphics, and to execute streaming audio and/or video applications. The transfer of Internet content to and from wireless device is typically facilitated by the Wireless Application Protocol (“WAP”), which integrates the Internet and other networks with wireless network platforms.
With respect to the transfer of content to and from the wireless device, in a typical HTTP-based client/server model (e.g., web browser/web server), an ECMA International (“ECMA”) compliant scripting language is typically used as a mechanism for providing dynamic content in HTML-based web pages, as such a scripting language is easy to use and easy to extend. In computer programming, a script is a program or sequence of instructions that is interpreted or carried out by another program rather than by the computer processor as a compiled program is. In the context of the Web, script languages are often written to handle forms input or other services for a Web site and are processed on the Web server. A script in a Web page, on the other hand, runs client-side on the Web browser. Thus, with a scripting language, dynamic content and generation logic may be embedded into HTML pages. ECMA host facilities in the Web browser, which are helpful in processing HTTP requests and responses, are built on the top of scripting language engine in the form of scripting objects with an extension method that is implied in ECMA specifications. One such specification is Standard ECMA-262 (or ISO/IEC 16262), entitled “ECMAScript Language Specification”, 3rd Edition (December 1999), and which is incorporated herein by reference.
However, certain features of scripting languages, such as “weak-typing” and the dynamic addition of named properties, prevent them from being used in complex applications, since these features make complex scripting-based applications bug-prone and difficult to maintain. In fact, this problem has been regarded as one of major drawbacks of scripting languages and hence ECMA compliant script is often considered as lacking security at a certain level. On the other hand, some data types, which are required by applications or services that the complex applications transact with, are often missing from the scripting model.
For reference, in computer programming, “weak-typing” refers to the strict enforcement of type rules but with well-defined exceptions or an explicit type-violation mechanism. Thus, while weak-typing may be programmer friendly, it catches fewer errors at compile time. C and C++ are usually considered to be languages with weak-typing as they automatically coerce many types (e.g., ints and floats as in the example int a=5; float b=a;). On the other hand, “strong-typing” refers to the strict enforcement of type rules with no exceptions. All types are known at compile time (i.e., they are statically bound). With variables that can store values of more than one type, incorrect type usage can be detected at runtime. Strong typing catches more errors at compile time than weak typing, resulting in fewer runtime exceptions. Java™ and Pascal are usually considered to be languages with strong-typing.
With respect to script languages in particular, they are often referred to as being “untyped” as in some of these languages a user need not declare the type of a variable before using it. The variable's type can be changed based on what has been assigned to it. For example, “var i”, where “i” can be assigned a value that is of any type, including primitives and objects, in its lifecycle. Thus, scripting languages in general may be referred to as being “untyped” and languages such as C, C++, and Java™ may be referred to as being “typed” (i.e., weakly-typed and/or strongly-typed). In general, scripting languages are more “untyped” than “typed”.
Moreover, simply replacing scripting with advanced languages such as Java™ or C++ in the development of a complex application often results in a longer development cycle and increased maintenance, which is at odds with the goals of a modern rapid application development (“RAD”) programming model.
A need therefore exists for an effective method and system for extending scripting languages for use in wireless and other devices. Accordingly, a solution that addresses, at least in part, the above and other shortcomings is desired.